package cn.edu.scau.cmi.dengyu.simpleFactoryMethod;

import cn.edu.scau.cmi.dengyu.domain.factory.Accident;
import cn.edu.scau.cmi.dengyu.domain.factory.CarDamaged;
import cn.edu.scau.cmi.dengyu.domain.factory.DriverInjured;
import cn.edu.scau.cmi.dengyu.domain.factory.MultipleAccidents;
import cn.edu.scau.cmi.dengyu.domain.factory.PeopleInjured;

public class AccidentFactory {
	public static Accident getInstance(String accidentTypeString){
		switch(accidentTypeString){
		case "司机受伤":return new DriverInjured();
		case "汽车损坏":return new CarDamaged();
		case "人员伤亡":return new PeopleInjured();
		case "多种事故":return new MultipleAccidents();

		}
		
		return null;
		
	}
}
